#include "OpFactory.h"

OpFactory::OpFactory( Problem *problem ) {

}

UnaryOp* OpFactory::getUnaryOp( int i ) throw (InvalidIndex) {
	if (i < 0 || i >= unaryOpList.size())
		throw InvalidIndex("i", 0, unaryOpList.size() - 1, i);

	return &unaryOpList[i];
}

UnaryOp* OpFactory::getRandomUnaryOp( double *w ) throw (InvalidIndex) {
	return getUnaryOp( Util::random(0, unaryOpList.size(), w) );
}

